1. Field of the Invention
The present invention relates to the field of data processing and in particular, to maintaining the coherency of data in a system made up of a plurality of masters connected via an interconnect to at least one memory for storing data, the system having local storage for copies of a subset of the data in one or more of the masters and possibly in the interconnect.
2. Description of the Prior Art
There are coherency issues associated with systems where a plurality of initiator devices or masters are connected via interconnect circuitry to a memory, and where there is local data storage provided for a subset of the data in the interconnect and/or in the initiator devices.
To address these issues coherent interconnects have been devised that have coherency control circuitry within them for maintaining an ordering of transaction requests that pass through them and for ensuring that if a data item is requested, the current version of the item is returned. The coherency control circuitry acts by generating snoop transactions (formed of a snoop request, a snoop response and optionally snoop data) that query the state of local stores such as caches and the values stored therein and ensure that the most up-to-date version of a requested data item is returned. When a copy in the local store is overwritten with a new value, this local copy is marked as dirty so that it is clear when a snoop is performed that this is the most recent version of that data item. At some point later the system will perform a writeback to write this new value to memory, whereupon the local copy is no longer marked as dirty and the memory also holds the most recent version.
The present technique recognises that as a consequence of the variable delays associated with transactions being performed upon a typically complex modern circuit, snoop requests and other transactions issued may complete in a different order to that in which they were issued.
The present technique also recognises that it is important that writebacks to the same address complete in the order they were issued. If this is not the case an earlier writeback will overwrite a later writeback and an out-of-date value of a data item will be stored in memory. This has been addressed previously by stalling any response to a snoop request accessing an address for which a writeback is pending and requesting that this request be sent again later. If this is done, any other transaction to this address cannot complete and thus, one can be assured that the writebacks will occur in the correct order. Disadvantages of this technique include the possibility of deadlock situations arising where a stalled snoop is required to complete for another request to complete and also the increased power consumption and latency associated with resending the snoop requests.
Embodiments of the present invention seek to address the problem associated with writebacks occurring out of order without unduly increasing power consumption or reducing performance.